<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>平闰年判定</title>
		
	</head>
	<body>
		请输入年分:<input type="text" name="" id="in1" value="" />
		<button type="button" id="bu">判定</button>
		判定结果：<span id="span"></span>
		<script type="text/javascript">
			var bu=document.getElementById("bu");
			var in1=document.getElementById("in1");
			var span=document.getElementById("span");
			
			bu.onclick=function(){
				var year=in1.value;
				year%100!=0&&year%4==0||year%400==0?span.innerHTML="闰年":span.innerText="平年";
				
			}
		</script>
		
	</body>
</html>
